package com.power.sifa.approve.model.doc;

import cn.hutool.core.util.ObjectUtil;
import com.power.sifa.approve.model.enumeration.Tp_procmaterial;
import lombok.Data;

/**
 * @ClassName ExecuteAuditReminderDoc
 * @Author xiongzw
 * @Date 2023/11/24 10:31
 * @Description 履行行政复议决定催告书
 * @Version: 1.0
 **/
@Data
public class ExecuteAuditReminderDoc extends AbstractDoc {

    /**
     * 申请人
     */
    private String apl_admreview_applyname;
    /**
     * 正文
     */
    private String content;

    /**
     * 补充内容
     */
    private String statement;


    private final static String TEMPLATE = "    {pronoun}不服{apl_admreview_targetname}的[{behavior}]申请行政复议一案，本府于{decisiondate}作出了《行政复议决定书》{prcode}变更了原行政行为，并于 {arrivedate}送达给你（你们或你单位）。你（你们或你单位）逾期不起诉又不履行行政复议决定，" +
            "根据《中华人民共和国行政强制法》第三十五条（依法自行行政强制执行的适用该条；申请法院强制执行的适用五十四条）的规定，现依法向你（你们或你单位）催告，请自收到本催告之日起{deadlineday}日内履行行政复议决定，逾期不履行的，本府将依法予以强制执行（或者依法申请人民法院强制执行）。";

    private final static String STATEMENT_TEMPLATE = "    {pronoun}可以自收到本催告之日起三日内提出陈述和申辩意见。逾期不陈述、申辩的，视为放弃陈述和申辩的权利。";


    public ExecuteAuditReminderDoc() {
        super();
        this.setDocType(Tp_procmaterial.HEAR_REMINDER);
    }

    public ExecuteAuditReminderDoc(String applyid) {
        super(applyid);
        this.setDocType(Tp_procmaterial.HEAR_REMINDER);
    }

    public ExecuteAuditReminderDoc(String applyid, String apl_admreview_applyname, String content,  String statement) {
        super(applyid);
        this.setDocType(Tp_procmaterial.HEAR_REMINDER);
        this.apl_admreview_applyname = apl_admreview_applyname;
        this.content = content;
        this.statement = statement;
    }

    @Override
    public AbstractDoc generateTemplate(String applyid) {
        ExecuteAuditReminderDoc template = new ExecuteAuditReminderDoc(applyid);
        // 案号
        template.setApl_admre_audit_code(this.getApl_admre_audit_code());
        template.setApl_admreview_applyname(ObjectUtil.isNotNull(this.getAdmreObj()) ? this.getAdmreObj().getApplyname() : "");
        String content = TEMPLATE.replace("{apl_admreview_targetname}", ObjectUtil.isNotNull(this.getAdmreObj()) ?
                this.getAdmreObj().getTargetname() : "" );
        content = content.replace("{pronoun}", this.transPronoun());
        content = content.replace("{behavior}", this.transBehavior());
        content = content.replace("{prcode}", this.transPrcode());
        content = content.replace("{decisiondate}", this.transModelToday(Boolean.FALSE));
        content = content.replace("{arrivedate}", this.transModelToday(Boolean.FALSE));
        content = content.replace("{deadlineday}", "10");
        template.setContent(content);
        String statement = STATEMENT_TEMPLATE.replace("{pronoun}", this.transPronoun());
        template.setStatement(statement);
        return template;
    }
}
